function getNowTime(timestamp, type = 1) {
	let nowDate = new Date(timestamp)
	console.log(nowDate, "-nowDate");
	const [year, month, day, hour, minute, second] =
		[
		  nowDate.getFullYear(),
		  nowDate.getMonth() + 1,
		  nowDate.getDate(),
		  nowDate.getHours(),
		  nowDate.getMinutes(),
		  nowDate.getSeconds()
		];
	// getDay() 获取的是星期
	let dateObj = {
		1: year + "-" + getZero(month) + "-" + getZero(day) + " " + getZero(hour) + ":" + getZero(minute),
		2: year + "年" + month + "月" + day + "日" + hour + ":" + minute + ":" + second,
		3: year + "-" + getZero(month) + "-" + getZero(day)
	}
	return dateObj[type]
      
}
/* 获取 时 和 分 */
const getHourseAndMinute = () => {
	let arr = [];
	for(let i = 0; i < 48; i++) {
		let seconds = i * 1800;
		arr.push(`${getZero(Math.floor(seconds / 60 / 60 % 24))}:${getZero(Math.floor(seconds / 60 % 60))}`)
	}
	// let str = `${getZero(Math.floor(seconds / 60 / 60 % 24))}:${getZero(Math.floor(seconds / 60 % 60))}`
	return arr
}
/* 
	个位数前补0 
 */
function getZero(num) { 
	if (parseInt(num) < 10) {
		num = '0' + num;
	}
	return num;
}
export {
	getNowTime,
	getHourseAndMinute
}
